package com.dyzx.hbb.modules.finance.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * 用户钱包表
 * @TableName finance_user_wallet
 */
@TableName(value ="finance_user_wallet")
@Data
public class FinanceUserWallet {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 状态: 1-草稿, 2-待处理, 3-已完成, 4-已取消
     */
    private Integer status;
    /**
     * 创建日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createDate;

    /**
     * 更新日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateDate;

    /**
     * 删除标记: 0-未删除, 1-已删除
     */
    private Integer deleted;

    /**
     * 操作人ID
     */
    private Long operatorId;

    /**
     * 钱包余额(单位:分)
     */
    private Long balance;

    /**
     * 积分值
     */
    private Integer integral;

    /**
     * 支付密码(MD5加密)
     */
    private String payPassword;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FinanceUserWallet other = (FinanceUserWallet) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
            && (this.getBalance() == null ? other.getBalance() == null : this.getBalance().equals(other.getBalance()))
            && (this.getIntegral() == null ? other.getIntegral() == null : this.getIntegral().equals(other.getIntegral()))
            && (this.getPayPassword() == null ? other.getPayPassword() == null : this.getPayPassword().equals(other.getPayPassword()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
        result = prime * result + ((getBalance() == null) ? 0 : getBalance().hashCode());
        result = prime * result + ((getIntegral() == null) ? 0 : getIntegral().hashCode());
        result = prime * result + ((getPayPassword() == null) ? 0 : getPayPassword().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", status=").append(status);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", deleted=").append(deleted);
        sb.append(", operatorId=").append(operatorId);
        sb.append(", balance=").append(balance);
        sb.append(", integral=").append(integral);
        sb.append(", payPassword=").append(payPassword);
        sb.append("]");
        return sb.toString();
    }
}